import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
import _createClass from "@babel/runtime/helpers/esm/createClass";
import _inherits from "@babel/runtime/helpers/esm/inherits";
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
import _isBoolean from "lodash/isBoolean";

/**
 * FieldDataPicker.js
 * @date 2018/11/14
 */
import React from 'react';
import { Form, Checkbox } from 'antd';
// import intl from 'utils/intl/index';
import { attributeNameProp, attributeTypeProp, attributeValueProp } from "../../config";
import DataType from "../../DataType";

var FieldDataPicker = /*#__PURE__*/function (_React$Component) {
  _inherits(FieldDataPicker, _React$Component);

  var _super = _createSuper(FieldDataPicker);

  function FieldDataPicker() {
    _classCallCheck(this, FieldDataPicker);

    return _super.apply(this, arguments);
  }

  _createClass(FieldDataPicker, [{
    key: "render",
    value: function render() {
      var _this$props = this.props,
          form = _this$props.form,
          _this$props$propValue = _this$props.propValues,
          propValues = _this$props$propValue === void 0 ? {} : _this$props$propValue;
      return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Form.Item, null, form.getFieldDecorator('showToday', {
        initialValue: propValues.showToday
      })( /*#__PURE__*/React.createElement(Checkbox, {
        checkedValue: true,
        unCheckedValue: false
      }, "\u663E\u793A\u4ECA\u5929\u6309\u94AE"))));
    }
  }]);

  return FieldDataPicker;
}(React.Component);

export { FieldDataPicker as default };
export function getConfigOfPropValues(propValues) {
  var newConfig = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];

  if (_isBoolean(propValues.showToday)) {
    var _newConfig$push;

    newConfig.push((_newConfig$push = {}, _defineProperty(_newConfig$push, attributeNameProp, 'showToday'), _defineProperty(_newConfig$push, attributeValueProp, propValues.showToday), _defineProperty(_newConfig$push, attributeTypeProp, DataType.Boolean), _newConfig$push));
  }

  return newConfig;
}
export var lifeUpgrade = [];
FieldDataPicker.getConfigOfPropValues = getConfigOfPropValues;
FieldDataPicker.lifeUpgrade = lifeUpgrade;